<template>
	<view class="center">
		<view class="box">
			<view class="img">
				<image class="img_avatar" src="../../static/index/me.jpg"></image>
			</view>
			<hr style="width:50%; border: 1px solid #4d4d4d;">
			<view style="width:80%" class="container">
				<text>一个斗码大陆苦逼的三段码之气的少年，并没有神秘戒指中码老的帮助，但总有一天，我会成为斗码大陆中码帝一样的存在。三十年河东，三十年河西，莫欺少年穷。</text>
			</view>
			<hr style="width: 80%; border: 1px solid #4d4d4d; margin-top: 0.5em">
		</view>
		
		
		<view class="foot">
			工具箱已营业:<text>{{ time }}</text>(❁´◡`❁)
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				time: ''
			}
		},
		methods: {
			
		},
		mounted() {
			var that = this
			// 运行时间统计
			function secondToDate(second) {
				if (!second) {
					return 0;
				}
				const time = [0, 0, 0, 0, 0];
				if (second >= 365 * 24 * 3600) {
					time[0] = parseInt(second / (365 * 24 * 3600));
					second %= 365 * 24 * 3600;
				}
				if (second >= 24 * 3600) {
					time[1] = parseInt(second / (24 * 3600));
					second %= 24 * 3600;
				}
				if (second >= 3600) {
					time[2] = parseInt(second / 3600);
					second %= 3600;
				}
				if (second >= 60) {
					time[3] = parseInt(second / 60);
					second %= 60;
				}
				if (second > 0) {
					time[4] = second;
				}
				return time;
			}
			function setTime() {
				/*此处为网站的创建时间*/
				const create_time = Math.round(new Date(Date.UTC(2023, 8 - 1, 17, 20, 0, 0)).getTime() / 1000);
				const timestamp = Math.round((new Date().getTime() + 8 * 60 * 60 * 1000) / 1000);
				const currentTime = secondToDate((timestamp - create_time));
				const currentTimeHtml = currentTime[0] + '年' + currentTime[1] + '天'
						+ currentTime[2] + '时' + currentTime[3] + '分' + currentTime[4]
						+ '秒';
				that.time = currentTimeHtml;
			}
			setInterval(setTime, 1000);
		}
	}
</script>

<style>
.center {
	height: 100%;
	flex: auto;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}
.box{
	margin-top: 10px;
	width: 90%;
	border: #919397 2px solid;
	border-radius: 15rpx;
	padding: 10rpx;
	height: 100%;
	flex: auto;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	background-color: antiquewhite;
}
.container {
	color: black;
	letter-spacing: 0;
	text-align: center;
	line-height: 2em;
}
.img{
	margin: 50rpx 0;
}
.img_avatar{
	border-radius: 10em;
	width: 10em;
	height: 10em;
	background-size: 13em;
}
.foot{
	width: 100%;
	height: 100%;
	text-align: center;
	color: #919397;
	margin-top: 1em;
	background-color: aqua;
	padding: 20rpx;
}
</style>
